/***********************************************************************
 * Module:  Test.java
 * Author:  DAC
 * Purpose: Defines the Class Test
 ***********************************************************************/
package com.group1.model;

/** @pdOid 58e3a3c8-fc95-4f32-8f61-3731c58bb939 */
public class Test {
   /** @pdOid 45bf9ef0-73a5-4129-89a0-e2676cb926b1 */
   public long testId;
   /** @pdOid 7ac04645-0c69-489e-a878-8411d7b0efb1 */
   public java.lang.String testDesc;
   /** in minutes
    * 
    * @pdOid d2e9fa3e-282e-42e0-9c2c-22f3fa39bc0f */
   public int testDuration;
   /** @pdOid 34bbd782-27e9-40ff-8052-b4b41d635259 */
   public boolean testIsValidated;
   /** @pdOid 43195a50-bb17-4a34-a4a7-8bb22478e68d */
   public float testTotalScore;
   
   /** @pdRoleInfo migr=no name=TestSection assc=testSectionInsideOfATest coll=java.util.Collection impl=java.util.HashSet mult=0..* */
   public java.util.Collection<TestSection> testSection;
   /** @pdRoleInfo migr=no name=Lecturer assc=creatorOfTests mult=0..1 side=A */
   public Lecturer TEST_CREATOR;
   /** @pdRoleInfo migr=no name=Lecturer assc=validatorOfTests mult=0..1 side=A */
   public Lecturer TEST_VALIDATOR;
   
   /** @pdOid 4f0785c4-95ba-475f-87dd-dde4a3520171 */
   public long getTestId() {
      return testId;
   }
   
   /** @param newTestId
    * @pdOid 8e1224f7-206a-4d08-8ea6-7ac68a17c79a */
   public void setTestId(long newTestId) {
      testId = newTestId;
   }
   
   /** @pdOid 7109ab27-4526-41fe-be0d-0735970620a2 */
   public java.lang.String getTestDesc() {
      return testDesc;
   }
   
   /** @param newTestDesc
    * @pdOid c4f154ba-2c62-4065-971e-44410eb035eb */
   public void setTestDesc(java.lang.String newTestDesc) {
      testDesc = newTestDesc;
   }
   
   /** @pdOid 06e6bd71-0217-45d8-bb94-a45d55c76e7d */
   public int getTestDuration() {
      return testDuration;
   }
   
   /** @param newTestDuration
    * @pdOid 3c53198f-8e6f-424a-9a75-e9574c9ad6a5 */
   public void setTestDuration(int newTestDuration) {
      testDuration = newTestDuration;
   }
   
   /** @pdOid 352db3fd-fa4d-43b5-8168-52255b2f9a60 */
   public boolean getTestIsValidated() {
      return testIsValidated;
   }
   
   /** @param newTestIsValidated
    * @pdOid 5894b515-7fff-4869-b60c-18e203714eaf */
   public void setTestIsValidated(boolean newTestIsValidated) {
      testIsValidated = newTestIsValidated;
   }
   
   /** @pdOid 835962d8-5d7e-44ac-997d-6e8c898266ea */
   public float getTestTotalScore() {
      return testTotalScore;
   }
   
   /** @param newTestTotalScore
    * @pdOid 51289807-aa96-4320-9722-825ced22b5ac */
   public void setTestTotalScore(float newTestTotalScore) {
      testTotalScore = newTestTotalScore;
   }
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<TestSection> getTestSection() {
      if (testSection == null)
         testSection = new java.util.HashSet<TestSection>();
      return testSection;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorTestSection() {
      if (testSection == null)
         testSection = new java.util.HashSet<TestSection>();
      return testSection.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newTestSection */
   public void setTestSection(java.util.Collection<TestSection> newTestSection) {
      removeAllTestSection();
      for (java.util.Iterator iter = newTestSection.iterator(); iter.hasNext();)
         addTestSection((TestSection)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newTestSection */
   public void addTestSection(TestSection newTestSection) {
      if (newTestSection == null)
         return;
      if (this.testSection == null)
         this.testSection = new java.util.HashSet<TestSection>();
      if (!this.testSection.contains(newTestSection))
      {
         this.testSection.add(newTestSection);
         newTestSection.setTest(this);      
      }
   }
   
   /** @pdGenerated default remove
     * @param oldTestSection */
   public void removeTestSection(TestSection oldTestSection) {
      if (oldTestSection == null)
         return;
      if (this.testSection != null)
         if (this.testSection.contains(oldTestSection))
         {
            this.testSection.remove(oldTestSection);
            oldTestSection.setTest((Test)null);
         }
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllTestSection() {
      if (testSection != null)
      {
         TestSection oldTestSection;
         for (java.util.Iterator iter = getIteratorTestSection(); iter.hasNext();)
         {
            oldTestSection = (TestSection)iter.next();
            iter.remove();
            oldTestSection.setTest((Test)null);
         }
      }
   }
   /** @pdGenerated default parent getter */
   public Lecturer getTEST_CREATOR() {
      return TEST_CREATOR;
   }
   
   /** @pdGenerated default parent setter
     * @param newLecturer */
   public void setTEST_CREATOR(Lecturer newLecturer) {
      if (this.TEST_CREATOR == null || !this.TEST_CREATOR.equals(newLecturer))
      {
         if (this.TEST_CREATOR != null)
         {
            Lecturer oldLecturer = this.TEST_CREATOR;
            this.TEST_CREATOR = null;
            oldLecturer.removeTest(this);
         }
         if (newLecturer != null)
         {
            this.TEST_CREATOR = newLecturer;
            this.TEST_CREATOR.addTest(this);
         }
      }
   }
   /** @pdGenerated default parent getter */
   public Lecturer getTEST_VALIDATOR() {
      return TEST_VALIDATOR;
   }
   
   /** @pdGenerated default parent setter
     * @param newLecturer */
   public void setTEST_VALIDATOR(Lecturer newLecturer) {
      if (this.TEST_VALIDATOR == null || !this.TEST_VALIDATOR.equals(newLecturer))
      {
         if (this.TEST_VALIDATOR != null)
         {
            Lecturer oldLecturer = this.TEST_VALIDATOR;
            this.TEST_VALIDATOR = null;
            oldLecturer.removeTestVal(this);
         }
         if (newLecturer != null)
         {
            this.TEST_VALIDATOR = newLecturer;
            this.TEST_VALIDATOR.addTestVal(this);
         }
      }
   }

}